//package cn.flying.cloud.esb.core.camel.route;
//
//import javax.annotation.Resource;
//
//import org.apache.camel.builder.RouteBuilder;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.context.ApplicationContext;
//import org.springframework.stereotype.Component;
//
//import cn.flying.cloud.esb.core.camel.process.ExceptionProcessor;
//import cn.flying.cloud.esb.core.camel.process.ForwardResolverProcessor;
//import cn.flying.cloud.esb.core.camel.process.ParamValidProcessor;
//
///**
// * @author: admin
// * @date: 2025年04月12日 16:11
// * @version: 1.0
// */
//@Component
//public class ReceiveHttpRoute extends RouteBuilder {
//    private final Logger logger = LoggerFactory.getLogger(this.getClass());
//
//    @Resource
//    private ApplicationContext applicationContext;
//
//    @Override
//    public void configure() throws Exception {
//        // 全局异常处理器
//        onException(Exception.class)
//                .handled(true)
//                .process(new ExceptionProcessor(applicationContext));
//
//        // 定义接收
//        from("undertow:http://0.0.0.0:30000/api/esb2")
//                .process(new ParamValidProcessor(applicationContext))
//                .process(new ForwardResolverProcessor(applicationContext))
//                // 根据消息头中的转发地址进行动态转发，并设置 bridgeEndpoint=true
//                .toD("${header.forwardUrl}")
//                .process(exchange -> {
//                    // 移除包含动态端点地址的消息头
//                    exchange.getIn().removeHeader("forwardUrl");
//                })
//                .setHeader("Content-Type", constant("application/json"));
//    }
//}
